<?php
    ob_start();
    session_start();

?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
</head>
<body>
<?php
    $data=$_GET["q"];
    $propinsix = $_SESSION["PROP_VAL"];
    include('class.mysql.php');
    $mydb = new mysql();
    $connection = $mydb->Connect();
    //ambil nama propinsi yang terpilih
    $sql="select propinsi,kode from propinsi where kode='$propinsix'";
    //echo "$sql";	
    $query = $mydb->Query($sql);
    $num = $mydb->FetchNum($query);
    if($array= mysql_fetch_row($query))
    {
        $propinsi[]=$array[0];
        $kode[]=$array[1];
    }
    else
    {
        $propinsi[]="Pilih Propinsi";
        $kode[]="XX";	
    }
    //ambil data propinsi
    $sql="select propinsi,kode from propinsi";// where kode='$propinsix'";
    //echo "$sql";	
    $query = $mydb->Query($sql);
    $num = $mydb->FetchNum($query);
    //$propinsi[]="Pilih Propinsi";
    //$kode[]="XX";
    while($array= mysql_fetch_row($query))
    {
        $propinsi[]=$array[0];
        $kode[]=$array[1];
    }
    //echo $data.$kabupaten[2];
    //ob_end_flush();
    // onchange="ChangeNoReg_updatelist(this.value)"
    $stTemp = '<select name="propinsi"  onchange="showlistkota(this.value);" value='.$_SESSION["PROP_VAL"].' disabled>';
    $i=0;
    while($kode[$i]!='')
    {
        $stTemp .= '<option value='.$kode[$i].'>' . $propinsi[$i] . '</option>';
        $i++;
    }
    $stTemp .= '</select>';
    echo    $stTemp;
    ob_end_flush();
?>
</body>

